Optimal. Leaf size=108 \[ \frac {2 a \left (c^2+3 c d+d^2\right ) \tan (e+f x)}{3 f}+\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a \tan (e+f x) (c+d \sec (e+f x))^2}{3 f}+\frac {a d (2 c+3 d) \tan (e+f x) \sec (e+f x)}{6 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {4002, 3997, 3787, 3770, 3767, 8} \[ \frac {2 a \left (c^2+3 c d+d^2\right ) \tan (e+f x)}{3 f}+\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a \tan (e+f x) (c+d \sec (e+f x))^2}{3 f}+\frac {a d (2 c+3 d) \tan (e+f x) \sec (e+f x)}{6 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 3787
Rule 3997
Rule 4002
Rubi steps
\begin {align*} \int \sec (e+f x) (a+a \sec (e+f x)) (c+d \sec (e+f x))^2 \, dx &=\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}+\frac {1}{3} \int \sec (e+f x) (c+d \sec (e+f x)) (a (3 c+2 d)+a (2 c+3 d) \sec (e+f x)) \, dx\\ &=\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}+\frac {1}{6} \int \sec (e+f x) \left (3 a \left (2 c^2+2 c d+d^2\right )+4 a \left (c^2+3 c d+d^2\right ) \sec (e+f x)\right ) \, dx\\ &=\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}+\frac {1}{2} \left (a \left (2 c^2+2 c d+d^2\right )\right ) \int \sec (e+f x) \, dx+\frac {1}{3} \left (2 a \left (c^2+3 c d+d^2\right )\right ) \int \sec ^2(e+f x) \, dx\\ &=\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}-\frac {\left (2 a \left (c^2+3 c d+d^2\right )\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{3 f}\\ &=\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {2 a \left (c^2+3 c d+d^2\right ) \tan (e+f x)}{3 f}+\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.43, size = 75, normalized size = 0.69 \[ \frac {a \left (3 \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))+\tan (e+f x) \left (2 \left (3 (c+d)^2+d^2 \tan ^2(e+f x)\right )+3 d (2 c+d) \sec (e+f x)\right )\right )}{6 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.48, size = 150, normalized size = 1.39 \[ \frac {3 \, {\left (2 \, a c^{2} + 2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (2 \, a c^{2} + 2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (2 \, a d^{2} + 2 \, {\left (3 \, a c^{2} + 6 \, a c d + 2 \, a d^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, {\left (2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{12 \, f \cos \left (f x + e\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.11, size = 174, normalized size = 1.61 \[ \frac {a \,c^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {2 a c d \tan \left (f x +e \right )}{f}+\frac {a \,d^{2} \sec \left (f x +e \right ) \tan \left (f x +e \right )}{2 f}+\frac {a \,d^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2 f}+\frac {a \,c^{2} \tan \left (f x +e \right )}{f}+\frac {a c d \sec \left (f x +e \right ) \tan \left (f x +e \right )}{f}+\frac {a c d \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {2 a \,d^{2} \tan \left (f x +e \right )}{3 f}+\frac {a \,d^{2} \tan \left (f x +e \right ) \left (\sec ^{2}\left (f x +e \right )\right )}{3 f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.47, size = 165, normalized size = 1.53 \[ \frac {4 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a d^{2} - 6 \, a c d {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 3 \, a d^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 12 \, a c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 12 \, a c^{2} \tan \left (f x + e\right ) + 24 \, a c d \tan \left (f x + e\right )}{12 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.76, size = 196, normalized size = 1.81 \[ \frac {a\,\mathrm {atanh}\left (\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,c^2+2\,c\,d+d^2\right )}{4\,c^2+4\,c\,d+2\,d^2}\right )\,\left (2\,c^2+2\,c\,d+d^2\right )}{f}-\frac {\left (2\,a\,c^2+2\,a\,c\,d+a\,d^2\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (-4\,a\,c^2-8\,a\,c\,d-\frac {4\,a\,d^2}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (2\,a\,c^2+6\,a\,c\,d+3\,a\,d^2\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a \left (\int c^{2} \sec {\left (e + f x \right )}\, dx + \int c^{2} \sec ^{2}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{2}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{3}{\left (e + f x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________